﻿@model IEnumerable<Modelo.Percurso>
@{
    ViewBag.Title = "Percurso";
}
<h2>Index</h2>
@{
  Html.Telerik().Grid(Model)
            .Name("Percurso")
            .ToolBar(commands => commands.Insert())
            .DataKeys(dataKeys => dataKeys.Add(model => model.Id))
            .DataBinding (dataBinding => dataBinding
                .Server()
                .Insert("Create", "Percurso")
                .Update("Edit", "Percurso")
                .Delete("Delete", "Percurso")
            )
            .Columns(columns =>
            {
                columns.Bound(model => model.Id).ReadOnly().Width(50);
                
                columns.Bound(model => model.Cliente).Width(250);
                columns.Bound(model => model.Nome).Width(250);
                columns.Bound(model => model.TempoEsperado).Width(250);
                columns.Command(commands => commands.Edit()).Width(100);
                columns.Command(commands => commands.Delete()).Width(100);
            }
            )
            .Pageable()
            .Sortable().Render();
        
    }